<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>subject_index</title>
    <link href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
    <style>
        body {
            background-color: aliceblue;
        }
    </style>
</head>
<body>
<br>
<br><br>
<div class="ui two column centered grid">
    <div class="column">
        <div class="ui action input">
            <a class="larger ui green button" th:href="@{/index}">返回</a>&nbsp;
            <a class="larger ui red button" th:href="@{/to_subject_add}">添加</a>&nbsp;
            <form class="ui form" th:action="@{/subject_search}" th:method="post">
                <div class="ui input focus">
                    <input name="keyword" placeholder="搜索..." type="text">
                </div>
                <button class="ui primary blue button">搜索</button>
            </form>
        </div>
        <table class="ui celled table">
            <thead>
            <tr>
                <th>ID</th>
                <th>名称</th>
                <th>类型</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="subject,it:${subjectList}">
                <td th:text="${subject.id}"></td>
                <td th:text="${subject.name}"></td>
                <td th:text="${subject.type}"></td>
                <td>
                    <button class="ui small button">
                        <a href="/to_subject_update" th:href="@{/to_subject_update(id=${subject.id})}">更新</a>
                    </button>
                    <button class="ui small button">
                        <a style="color: green;" th:href="@{/to_subject_detail(id=${subject.id})}">详情</a>
                    </button>
                    <button class="ui small button">
                        <a href="/to_subject_delete" style="color: red;"
                           th:href="@{/to_subject_delete(id=${subject.id})}">删除</a>
                    </button>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>
